package com.realaction.xmlparserdemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		Button btnsax = (Button) findViewById(R.id.btnsax);
		Button btndom = (Button) findViewById(R.id.btndom);
		Button btnpull = (Button) findViewById(R.id.btnpull);
		btnsax.setOnClickListener(this);
		btndom.setOnClickListener(this);
		btnpull.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent = new Intent();
		switch (v.getId()) {
		case R.id.btnsax:
			intent.setClass(getApplicationContext(), SaxParserActivity.class);
			break;
		case R.id.btndom:
			intent.setClass(getApplicationContext(), DomParserActivity.class);
			break;
		case R.id.btnpull:
			intent.setClass(getApplicationContext(), PullParserActivity.class);
			break;
		}
		startActivity(intent);
	}

}
